var chartData = [];

function addChartData(typeName, typeCount) {
	typeCount = parseInt(typeCount);
	var hashPos = typeName.indexOf('#');
	if (hashPos == -1) {
		parts = typeName.split('/');
	} else {
		parts = typeName.split('#');
	}

	typeName = parts[parts.length - 1];
	if (typeName.length > 0)
	{
		chartData[chartData.length] = [ typeName, typeCount ];
	}
}

function drawPieChart() {
	var dataTable = new google.visualization.DataTable();
	dataTable.addColumn('string');
	dataTable.addColumn('number');
	dataTable.addRows(chartData);

	chartSize = $(window).width() * (60/100);
	chartSize = parseInt(chartSize);
	
	var chart = new google.visualization.PieChart(document.getElementById('chart'));
    chart.draw(dataTable, {pieJoinAngle: 5, legendFontSize: 14, backgroundColor: {fill: '#EEE', stroke: '#CCC'}, width:chartSize, height:chartSize, is3D: true, legend: 'bottom'});
}